package cronjob

import (
	"kms-backend/controllers/cronjob"

	"github.com/gin-gonic/gin"
)

// 新增
func create(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.POST("/create", cronjob.Create)
}

// 更新
func update(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.POST("/update", cronjob.Update)
}

func detail(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.GET("/detail", cronjob.Detail)
}

func list(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.GET("/list", cronjob.List)
}

func delete(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.POST("/delete", cronjob.Delete)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	cronjobGroup := g.Group("/cronjob")
	create(cronjobGroup)
	update(cronjobGroup)
	detail(cronjobGroup)
	list(cronjobGroup)
	delete(cronjobGroup)

}
